package com.example.springbootredis.service.impl;

import com.example.springbootredis.entiy.Region;
import com.example.springbootredis.repository.RegionRepository;
import com.example.springbootredis.service.RegionService;
import jakarta.persistence.Cacheable;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class RegionServiceImpl implements RegionService {
    @Autowired
    private RegionRepository regionRepository;

    @Override
    public List<Region> findByParentId(Integer parentId) {
        return regionRepository.findByParentId(parentId);
    }

    @Override
    public List<Region> findByLevel(Integer level) {
        return regionRepository.findByLevel(level);
    }
}
